#/usr/bin/env python
# gdata-python-client
# http://code.google.com/p/gdata-python-client/downloads/list
#
# require httplib,urllib


import sys

if len(sys.argv)!=3:
  print >>sys.stderr,"usage: %s <user@domain> <password>"%sys.argv[0]
  sys.exit(2)


import atom.data
import gdata.sites.client
import gdata.sites.data

user,domain=sys.argv[1].split("@")
password=sys.argv[2]

client = gdata.sites.client.SitesClient(source=domain)
client.ssl = True
client.http_client.debug = True

# See also
# http://code.google.com/apis/gdata/faq.html#clientlogin
token=client.ClientLogin("%s@%s"%(user,domain),password,"jotspot")

#print dir(client)

feed = client.GetSiteFeed(uri=client.MakeSiteFeedUri())#+"?include-all-sites=true")

print feed.entry

for e in feed.entry:
  print e.title.text

